package nl.memedefense.tower;

import nl.memedefense.core.ItemCategory;
import nl.memedefense.core.Purchasable;

/**
 * Base class for all Towers. A tower is a graphical component that is drawn on a screen. A tower has to be purchased
 * and is used to defeat monsters.
 * <p/>
 * This base class defines features that all towers have.
 *
 * @author Robin van Breukelen
 */
public abstract class Tower implements Purchasable {

    /**
     * A tower has base damage. This is the basic damage that a tower does. The total damage of tower can vary because
     * it can be influenced by upgrades, critical hits etc.
     *
     * @return float that represents the absolute base damage that it does, should not be negative.
     */
    public abstract float getBaseDamage();

    /**
     * {@inheritDoc}
     */
    @Override
    public ItemCategory getCategory() {
        return ItemCategory.TOWER;
    }

    /**
     * Retrieves the level of this Tower. When a user upgrades a tower its level is different than before.
     *
     * @return {@link TowerUpgradeStatus} current status of the tower.
     */
    public abstract TowerUpgradeStatus getLevel();

    /**
     * Upgrades this tower to a specified {@link TowerUpgradeStatus}. This method takes a {@link TowerUpgradeStatus}
     * because it does not necessarily have to upgrade to the level that is next in line in some cases levels can be
     * skipped.
     *
     * @param nextLevel {@link TowerUpgradeStatus} that is to be the new level of this tower.
     */
    public abstract void upgrade(TowerUpgradeStatus nextLevel);

    /**
     * Returns what the next level of the tower should be.
     *
     * @return {@link TowerUpgradeStatus} that should be the next level.
     */
    public abstract TowerUpgradeStatus getNextLevel();

}
